using System;
using System.Text.RegularExpressions;


namespace InterpreteScheme
{
    class Util
    {
        static Regex rfloat = new Regex("^[0-9]+\\.[0-9]+$");
        static Regex rint   = new Regex("^[0-9]+$");

        public static void mostrar (string texto, ConsoleColor cc)
        {
            ConsoleColor anterior   = Console.ForegroundColor;
            Console.ForegroundColor = cc;
            Console.Write (texto);
            Console.ForegroundColor = anterior;
        }

        public static bool esNumero (string s)
        {
            return (rfloat.IsMatch (s) || rint.IsMatch (s));
        }

        public static bool esFloat (string s)
        {
            return rfloat.IsMatch(s);
        }

        public static bool esInt (string s)
        {
            return rint.IsMatch(s);
        }
    }
}
